import { BasicFetchResult } from '/@/api/model/baseMode';
import { LogItem, LogListQueryParams } from './model/logModel';
import { defHttp } from '/@/utils/http/axios';

import { ErrorMessageMode } from '/@/utils/http/axios/types';

enum Api {
  List = '/monitor/operlog/list',
}

/**
 * @description: 日志列表查询
 */
export function listApi(params: LogListQueryParams, mode: ErrorMessageMode = 'modal') {
  return defHttp.get<BasicFetchResult<LogItem>>(
    {
      url: Api.List,
      params,
    },
    {
      errorMessageMode: mode,
    }
  );
}
